import request from '@/utils/request'
/**
 * 教师列表api
 */
export default {
  /**
   *
   * @returns 教师列表
   */
  list() {
    return request({
      url: '/service-edu/admin/edu/teacher/list',
      method: "get"
    })
  },

  /**
   * 教师列表 分页查询
   * @param {*} page
   * @param {*} limit
   * @returns
   */
  pageList(page, limit, searchObj) {
    return request({
      url: `/service-edu/admin/edu/teacher/list/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  /**
   * 根据id逻辑删除教师
   * @param {*} id
   * @returns
   */
  removeById(id) {
    return request({
      url: `/service-edu/admin/edu/teacher/removeById/${id}`,
      method: 'delete',

    })
  },
  /**
   * 添加教师
   * @param {*} teacher
   * @returns
   */
  save(teacher) {
    return request({
      url: '/service-edu/admin/edu/teacher/save',
      method: 'post',
      data: teacher
    })
  },
  /**
   *
   * @param {根据id查询教师} id
   * @returns
   */
  getById(id) {
    return request({
      url: `/service-edu/admin/edu/teacher/get/${id}`,
      method: 'post'
    })
  },
  /**
   * 根据id更新教师
   * @param {*} teacher
   * @returns
   */
  updateById(teacher) {
    return request({
      url: '/service-edu/admin/edu/teacher/update',
      method: 'post',
      data: teacher
    })
  },

  deleteByIds(idList) {
    return request({
      url: '/service-edu/admin/edu/teacher/batch-remove',
      method: 'delete',
      data: idList
    })
  },

  selectNameListByKey(key) {
    return request({
      url: `/service-edu/admin/edu/teacher/get/${key}`,
      method: 'get'

    })
  }
}
